﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;

namespace QUANLYBANSACH_DAL
{
    public class SqlConnectionData
    {
        public static SqlConnection connect()
        {
            SqlConnection con = new SqlConnection(@"Data Source=(local);
                Initial Catalog=QUANLYBANSACH; Integrated Security=True;");
            return con;
        }

        public static void disconnect(SqlConnection con)
        {
            con.Close(); // Đóng kết nối
            con.Dispose(); // Giải phóng tài nguyên
            con = null; // Hủy đối tượng
        }
    }
}
